/*
	@file: log/include/Singleton.h
	@author: Wolfhead
 */
#ifndef _LOG_SINGLETON_H_
#define _LOG_SINGLETON_H_


namespace logger
{

template<typename T>
class Singleton
{
public:
	static T& instance()
	{
		assert(!m_destructed);
		(void)m_destructed;

		static T instance;
		return instance;
	}

private:

	static bool m_destructed;
};


template<typename T>
bool Singleton<T>::m_destructed = (
	Singleton::instance(),
	false);

}//namespace logger

#endif
